﻿
using RTW.DAL;
using RTW.OA.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace RTW.OA.Areas.Common.Servers
{
    public class CarOperatorServers
    {
	    private readonly IRepository<vehicle_operator> vehicle_operatorRepository;

        public CarOperatorServers()
        {
            vehicle_operatorRepository = new DapperRepository<vehicle_operator>();

        }

        public List<vehicle_operator> GetData()
        {
            var datas = vehicle_operatorRepository.GetAllEnumerable();
            return datas.ToList();
        }

        public vehicle_operator GetModelById(string id)
        {
            return vehicle_operatorRepository.GetById(id);
        }

		
        internal void Add(vehicle_operator model)
        {
            vehicle_operatorRepository.Insert(model);
        }

        internal void Update(vehicle_operator model)
        {
            vehicle_operatorRepository.Update(model);
        }

		internal void Del(string id)
        {
            vehicle_operatorRepository.DeleteByIds(id);
        }
    }
}